<!--{include manage_header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	<div class="dashboard" id="dashboard">
		<ul>${mcurrent_team($selector)}</ul>
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
				<!--{if $selector=='failure'}-->
                    <h2>失败项目</h2>
				<!--{elseif $selector=='success'}-->
                    <h2>成功项目</h2>
				<!--{else}-->
                    <h2>当前项目</h2>
				<!--{/if}-->
					<ul class="filter">
						<li><form method="get">项目ID：<input type="text" class="h-input" style="width:80px" name="tid" value="${htmlspecialchars($tid)}" >&nbsp;项目名称(模糊)：<input type="text" class="h-input" style="width:230px" name="tname" value="${htmlspecialchars($tname)}" >&nbsp;城市：<select name="city_id" style="width:100px;">${Utility::Option($citys, $_GET['city_id'],'请选择城市')}</select>&nbsp;类型：<select name="gid" style="width:120px;">${Utility::Option($groupss, $_GET['gid'],'请选择分类')}</select>&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/><form></li>
					</ul>
				</div>
                <div class="sect" style="padding-top:0">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th colspan="8"><input type="button" class="formbutton" style="padding:1px 6px;" id="do-checks" value="延期" />  <input type="button" class="formbutton" style="padding:1px 6px;" id="do-checks-addnum" value="加数" /></th></tr>
					<tr><th><input type="checkbox" id="check-team-id"></th><th width="40">ID</th><th width="400">项目名称</th><th width="80" nowrap>类别</th><th width="100">日期</th><th width="50">成交</th><th width="60" nowrap>价格</th><th width="60" nowrap>排序</th><th width="140">操作</th></tr>
					<!--{loop $teams $index $one}-->
					<!--${$oldstate = $one['state']}-->
					<!--${$one['state'] = team_state($one)}-->
					<tr ${$index%2?'':'class="alt"'} id="team-list-id-{$one['id']}">
						<td><input type="checkbox" id="checkid_{$one['id']}" name="cbname" value="{$one['id']}" ></td>
						<td>{$one['id']}<br /><a href="/manage/partner/edit.php?id={$partners[$one['partner_id']]['id']}"><font size="-1">{$partners[$one['partner_id']]['title']}</font></a></td>
						<td>
							<!--{if $one['proxy_id'] != 0}--><a class="ajaxlink" href="/ajax/manage.php?action=edit_proxy&id={$one['proxy_id']}"><font color=green>[代理]</font></a><!--{/if}-->
							<a class="deal-title" href="/team.php?id={$one['id']}" target="_blank"><!--{if $one['short_title']}-->{$one['short_title']}<!--{else}-->{$one['product']}<!--{/if}--></a>
						</td>
						<td nowrap>{$cities[$one['city_id']]['name']}<br/>{$groups[$one['group_id']]['name']}</td>
						<td nowrap>${date('Y-m-d',$one['begin_time'])}<br/>${date('Y-m-d',$one['end_time'])}</td>
						<td nowrap>{$one['now_number']}/{$one['min_number']}</td>
						<td nowrap><span class="money">{$currency}</span>${moneyit($one['team_price'])}<br/><span class="money">{$currency}</span>${moneyit($one['market_price'])}</td>

						<script type="text/javascript">
							function show_sort_order_input(id){
								spanid = 'sort_order'+id;
								inputid = 'input_sort_order'+id;
								inputtxt = 'input_sort_order_text'+id;
								$("#"+spanid).remove();
								$("#"+inputid).show();
								$("#"+inputtxt).focus();
								$("#"+inputtxt).select();
							}
							function shange_sort_order(id, sort_order){
								return !X.get(WEB_ROOT + '/ajax/manage.php?action=shange_sort_order&id='+id+'&sort_order='+sort_order);
							}
						</script>
						<td><span id="input_sort_order{$one['id']}" style="display:none"><input id="input_sort_order_text{$one['id']}" type="text" style="width:40px" value="{$one['sort_order']}" onblur="shange_sort_order({$one['id']}, this.value)" /></span><span id="sort_order{$one['id']}" ondblclick="show_sort_order_input({$one['id']});">{$one['sort_order']}</span></td>

						<td class="op" nowrap><a href="/ajax/manage.php?action=teamdetail&id={$one['id']}" class="ajaxlink">详情</a>｜<a href="/manage/team/edit.php?id={$one['id']}">编辑</a>｜<a href="/ajax/manage.php?action=teamremove&id={$one['id']}" class="ajaxlink" ask="确定删除本项目吗？" >删除</a><!--{if (in_array($one['state'],array('success','soldout')))}-->｜<a href="/manage/team/down.php?id={$one['id']}" target="_blank">下载</a><!--{/if}--><!--{if $one['delivery']=='express'}--><br /><a href="/manage/team/ajax.php?action=smsexpress&id={$one['id']}" class="ajaxlink">短信快递单号</a><!--{/if}--><br />
                        <!--${
							$cate_api_arr = unserialize($one['cate_api']);
							$cate_360_arr = explode('>', $cate_api_arr['tuan360']);
							if(empty($cate_api_arr['baidu']) || empty($cate_api_arr['tuan360']) || empty($cate_360_arr[1]) || empty($cate_api_arr['tuan800'])){
								echo "<a style='color:red' href='/manage/team/editapi.php?id=$one[id]' ><b>API未编辑</b></a>";
							}
						}-->
                        </td>
					</tr>
					<!--{/loop}-->
					<tr><td colspan="9">{$pagestring}</tr>
                    </table>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<script type="text/javascript">
//处理复选框
$(function(){
	$("#check-team-id").click(function(){
		if($("#check-team-id").attr("checked")){
			$("input:checkbox").attr("checked",true);
		}else{
			$("input:checkbox").attr("checked",false);
		}
	});
    //批量延期
	$("#do-checks").click(function(){
		check_val = new Array();
		$("input[name='cbname']:checkbox").each(function(){
			if($(this).attr("checked")){
				check_val.push( $(this).val());
			}
		});
		if(check_val == ''){
			alert("没有选中任何项目！");
			return false;
		}else{
			return !X.get(WEB_ROOT + '/ajax/manage.php?action=extension_team&ids='+check_val);
		}
		//alert("http://www.51uutuan.com/index.php?id="+check_val);
	});
    //批量加数
    $("#do-checks-addnum").click(function(){
		check_val = new Array();
		$("input[name='cbname']:checkbox").each(function(){
			if($(this).attr("checked")){
				check_val.push( $(this).val());
			}
		});
		if(check_val == ''){
			alert("没有选中任何项目！");
			return false;
		}else{
			return !X.get(WEB_ROOT + '/ajax/manage.php?action=add_pre_num&ids='+check_val);
		}
		//alert("http://www.51uutuan.com/index.php?id="+check_val);
	});
    
})
</script>

<!--{include manage_footer}-->
